package com.dragon.lib_mvi.base

import androidx.lifecycle.ViewModel
import com.dragon.lib_mvi.IIntent
import com.dragon.lib_mvi.IViewModel
import kotlinx.coroutines.channels.Channel

/***
 * @ClassName BaseViewModel
 * @Author Administrator
 * @description
 * @date 2025/2/24
 */
abstract class BaseViewModel<I : IIntent> : ViewModel(), IViewModel<I> {
    protected val intent_ = Channel<I>(Channel.UNLIMITED)
    override val Intent: Channel<I>
        get() = intent_

    init {
        handeIntent()
    }

    /*
    * 根据不同的意图处理不同的业务逻辑
    * */
    abstract fun handeIntent()
    

}